package org.smart4j.framework.proxy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smart4j.framework.annotation.Transaction;

import java.lang.reflect.Method;

/**
 * 事务切面类
 */
//public class TransactionProxy implements Proxy {

//    private static final Logger LOGGER = LoggerFactory.getLogger(TransactionProxy.class);
//
//    private static final ThreadLocal<Boolean> FLAG_HOLDER = new ThreadLocal<Boolean>(){
//        @Override
//        protected Boolean initialValue() {
//            return false;
//        }
//    };
//
//    @Override
//    public Object doProxy(ProxyChian proxyChian) {
//        boolean flag = FLAG_HOLDER.get();
//        Method method = proxyChian.getTargetMehtod();
//        if(method.isAnnotationPresent(Transaction.class)){
//            FLAG_HOLDER.set(true);
//
//        }
//    }
//}
